package shuashuami.hb.com.view;

import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

import shuashuami.hb.com.avtivity.CPerfectDataActivity;
import shuashuami.hb.com.hbclient.R;

/**
 * Created by Administrator on 2017/6/20.
 */

public class IsHaveDailiBianmaDialog extends Dialog {

    private String type;
    private Activity activity;
    private TextView tvData;

    private String phone;

    public IsHaveDailiBianmaDialog(Activity context, String phone) {
        super(context, R.style.Dialog);
        this.activity = context;
        this.phone = phone;
        setCustomDialog();
    }

    private void setCustomDialog() {
        View mView = LayoutInflater.from(getContext()).inflate(R.layout.dialog_ishave_daili, null);
        Button btnCancle = (Button) mView.findViewById(R.id.btn_change_content_cancle);
        Button have = (Button) mView.findViewById(R.id.btn_change_content_have_daili);
        Button no = (Button) mView.findViewById(R.id.btn_change_content_no_daili);
        btnCancle.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
        have.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
                Intent intent = new Intent();
                intent.putExtra("phone", phone);
                intent.putExtra("hasAgentnum", "1");
                intent.setClass(activity, CPerfectDataActivity.class);
                activity.startActivity(intent);
                activity.finish();
            }
        });

        no.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
                Intent intent = new Intent();
                intent.putExtra("phone", phone);
                intent.putExtra("hasAgentnum", "0");
                intent.setClass(activity, CPerfectDataActivity.class);
                activity.startActivity(intent);
                activity.finish();
            }
        });
        super.setContentView(mView);
    }

    @Override
    public void setContentView(int layoutResID) {
    }

    @Override
    public void setContentView(View view, ViewGroup.LayoutParams params) {
    }

    @Override
    public void setContentView(View view) {
    }
}
